import {createRouter, createWebHistory} from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL), routes: [{
    path: '/index',
    name: 'index',
    component: () => import('@/views/IndexView.vue'),
    children: [{
      path: '',
      name: 'index-home',
      component: () => import('@/components/index/HomePage.vue'),
    }, {
      path: '/my-article',
      name: 'index-myArticle',
      component: () => import('@/components/index/ArticlesPage.vue'),
    }, {
      path: '/my-article/new',
      name: 'index-myArticle-new',
      component: () => import('@/components/index/NewArticlePage.vue'),
    }, {
      path: '/my-article/update',
      name: 'index-myArticle-update',
      component: () => import('@/components/index/UpdateArticlePage.vue'),
    }, {
      path: '/audit',
      name: 'index-audit',
      component: () => import('@/components/index/AuditPage.vue'),
    }, {
      path: '/article',
      name: 'index-article',
      component: () => import('@/components/index/WatchArticlePage.vue'),
    }, {
      path: '/type',
      name: 'index-type',
      component: () => import('@/components/index/TypePage.vue'),
    }]
  }, {
    path: '/',
    name: 'welcome',
    component: () => import('@/views/WelcomeView.vue'),
    children: [{
      path: '',
      name: 'welcome-login',
      component: () => import('@/components/welcome/LoginPage.vue'),
    }, {
      path: '/register',
      name: 'welcome-register',
      component: () => import('@/components/welcome/RegisterPage.vue'),
    }, {
      path: '/forget',
      name: 'welcome-forget',
      component: () => import('@/components/welcome/ForgetPage.vue'),
    }]
  }]
})


export default router
